package com.dmap.knowledge.vo;

import com.dmap.knowledge.cache.po.HotArticleCachePo;
import com.dmap.knowledge.cache.po.TodayArticleCachePo;
import com.dmap.knowledge.po.Article;

import java.io.Serializable;
import java.util.List;

public class ArticleDetailVo implements Serializable {

    private Long articleId;         //articleId
    private List<String> tags;      //article标签
    private String coverUrl;        //封面的url
    private String articleUrl;      //article链接
    private String title;           //文章标题
    private String summary;         //简介
    private Integer browseNumber;   //阅览数量


    public ArticleDetailVo() {
    }

    public ArticleDetailVo(TodayArticleCachePo todayArticleCachePo) {
        if (todayArticleCachePo.getArticleId() != null) {
            this.articleId = todayArticleCachePo.getArticleId();
        }
        if (todayArticleCachePo.getTags() != null) {
            this.tags = todayArticleCachePo.getTags();
        }
        if (todayArticleCachePo.getCoverUrl() != null) {
            this.coverUrl = todayArticleCachePo.getCoverUrl();
        }
        if (todayArticleCachePo.getArticleUrl() != null) {
            this.articleUrl = todayArticleCachePo.getArticleUrl();
        }
        if (todayArticleCachePo.getTitle() != null) {
            this.title = todayArticleCachePo.getTitle();
        }
        if (todayArticleCachePo.getSummary() != null) {
            this.summary = todayArticleCachePo.getSummary();
        }
        if (todayArticleCachePo.getBrowseNumber() != null) {
            this.browseNumber = todayArticleCachePo.getBrowseNumber();
        }
    }

    public ArticleDetailVo(HotArticleCachePo hotArticleCachePo) {
        if (hotArticleCachePo.getArticleId() != null) {
            this.articleId = hotArticleCachePo.getArticleId();

        }
        if (hotArticleCachePo.getCoverUrl() != null) {
            this.coverUrl = hotArticleCachePo.getCoverUrl();

        }
        if (hotArticleCachePo.getArticleUrl() != null) {
            this.articleUrl = hotArticleCachePo.getArticleUrl();

        }
        if (hotArticleCachePo.getTitle() != null) {
            this.title = hotArticleCachePo.getTitle();

        }
        if (hotArticleCachePo.getSummary() != null) {
            this.summary = hotArticleCachePo.getSummary();

        }
        if (hotArticleCachePo.getBrowseNumber() != null) {
            this.browseNumber = hotArticleCachePo.getBrowseNumber();
        }
        if (hotArticleCachePo.getTags() != null) {
            this.tags = hotArticleCachePo.getTags();
        }
    }

    public ArticleDetailVo(Article article) {
        if (article.getId() != null) {
            this.articleId = article.getId();

        }
        if (article.getCoverUrl() != null) {
            this.coverUrl = article.getCoverUrl();

        }
        if (article.getArticleUrl() != null) {
            this.articleUrl = article.getArticleUrl();

        }
        if (article.getTitle() != null) {
            this.title = article.getTitle();

        }
        if (article.getSummary() != null) {
            this.summary = article.getSummary();

        }
        if (article.getBrowseNumber() != null) {
            this.browseNumber = article.getBrowseNumber();
        }

    }

    public Long getArticleId() {
        return articleId;
    }

    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public String getCoverUrl() {
        return coverUrl;
    }

    public void setCoverUrl(String coverUrl) {
        this.coverUrl = coverUrl;
    }

    public String getArticleUrl() {
        return articleUrl;
    }

    public void setArticleUrl(String articleUrl) {
        this.articleUrl = articleUrl;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public Integer getBrowseNumber() {
        return browseNumber;
    }

    public void setBrowseNumber(Integer browseNumber) {
        this.browseNumber = browseNumber;
    }
}
